Best Eight Projects with Arduino by Elif AVCU

Best Eight Projects with Arduino by Elif AVCU

Author:Elif AVCU [AVCU, Elif]
Language: eng
Format: azw3
Published: 2018-08-04T16:00:00+00:00


/*

- wait all of end points move to expect site

- blocking function

---------------------------------------------------------------------------*/

void wait_all_reach(void)

{

for (int i = 0; i < 4; i++) wait_reach(i); } /* - trans site from cartesian to polar - mathematical model 2/2 ---------------------------------------------------------------------------*/ void cartesian_to_polar(volatile float &alpha, volatile float &beta, volatile float &gamma, volatile float x, volatile float y, volatile float z) { //calculate w-z degree float v, w; w = (x >= 0 ? 1 : -1) * (sqrt(pow(x, 2) + pow(y, 2)));

v = w - length_c;

alpha = atan2(z, v) + acos((pow(length_a, 2) - pow(length_b, 2) + pow(v, 2) + pow(z, 2)) / 2 / length_a / sqrt(pow(v, 2) + pow(z, 2)));

beta = acos((pow(length_a, 2) + pow(length_b, 2) - pow(v, 2) - pow(z, 2)) / 2 / length_a / length_b);

//calculate x-y-z degree

gamma = (w >= 0) ? atan2(y, x) : atan2(-y, -x);

//trans degree pi->180

alpha = alpha / pi * 180;

beta = beta / pi * 180;

gamma = gamma / pi * 180;

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.